home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-06 / segue.exe / NSPLLPT.PRG < prev    next >
Text File  |  1991-10-28  |  1KB  |  42 lines

  1. *.............................................................................
  2. *
  3. *   Program Name: NSPLLPT.PRG       Copyright: HRF Associates, Inc.
  4. *   Date Created: 10/28/11           Language: Clipper
  5. *   Time Created: 22:54:40             Author: Bob Fogle
  6. *
  7. *.............................................................................
  8. * Supplemental SEGUE function for setting local LPT number to be captured by spooler.
  9. * Functionally equivilent to N_SPLLPT function in NETLIB library except it provides
  10. * for 4 server printers instead of 99.
  11. *
  12. FUNCTION NSPLLPT_
  13. *Purpose : To specify the local LPT number to be captured by spooler.
  14. *Usage     : NSPLLPT_([<expN1>])
  15. *        :
  16. * Where  : <expN1> = LPT number [1..3]
  17. *        :
  18. PARAMETERS lptno
  19. LOCAL mlptno
  20. PRIVATE rtn :=0
  21.  
  22. do while .t.
  23.   * Check to make sure passed variable types are correct.
  24.   if valtype(lptno)<>'N' .AND. lptno<>nil
  25.     rtn = -101
  26.     exit
  27.   endi
  28.  
  29.   * Set up defaults
  30.   mlptno =  if(valtype(lptno)=='N',lptno,0)
  31.   mlptno = if(mlptno=0,1,mlptno)  // Treat zero as one.
  32.  
  33.   * Get/Set lptno (form) number
  34.   if pcount()=0             // If no arguments, return current setting.
  35.     rtn = PRLCDFG()         // Get Default LPT Device
  36.   else
  37.     rtn = PRLCDFS(mlptno)   // Set Default LPT Device
  38.   endi
  39.   exit
  40. endd
  41. RETURN rtn
  42.